<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>


    <script>
        let promise=new Promise((success,fail)=>{
            // success("成功咯");
            // fail("啊哦")

            //只放成功的，失败就抛异常
            throw new Error("交互失败了")
        })


        promise.then(
            (res)=>{
                console.log("成功："+res);
                }
).catch((err)=>{
    console.log("错误信息是："+err);
    
})


console.log("主线程代码在这里");




    </script>
</head>
<body>
    
</body>
</html>